const util = require("../../utils/util.js");
var app = getApp();
const requestManager = require("../../utils/request.js");
var router = require('../../utils/router.js');
let orderId = ''
Component({
  lifetimes: {
    attached: function() {
      // 在组件实例进入页面节点树时执行
      this.getServiceType()
    },
    detached: function() {
      // 在组件实例被从页面节点树移除时执行
    },
  },
  properties: {
    orderId: {
      type: Number,
      value: -1,
    }
  },
  data: {
    serviceType:[],
    serviceVisible: false,
  },
  methods: {
    getServiceType() {
      requestManager.getDataResult(requestManager.service_type, {}, "GET").then(res => {
        this.setData({
          serviceType: res.list ? res.list : [],
        })
      })
    },
    handleserviceVisible(){
      this.setData({
        serviceVisible: !this.data.serviceVisible
      })
    },
    handleCheckServer(event){
      this.handleserviceVisible()
      let url = "/pages/reimburse/reimburse";
      router.route.setAction(router.NAVIGATE_TO)
      .setParams([`id=${event.currentTarget.id}&orderId=${this.data.orderId}`])
      .setUrl(url)
      .run()
    },
    confirm () {
      // this.triggerEvent('parentEvent',{})
     }
  }
})